package ink.charon.novel.core;

import ink.charon.novel.core.processor.TestProcessor;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.downloader.HttpClientDownloader;
import us.codecraft.webmagic.proxy.Proxy;
import us.codecraft.webmagic.proxy.SimpleProxyProvider;

public class SpiderTest {

    public static void main(String[] args) {
        HttpClientDownloader downloader = new HttpClientDownloader();
        downloader.setProxyProvider(SimpleProxyProvider.from(
                new Proxy("182.86.7.86",63595,"navyjc","ernv4xp2")
        ));
        Spider.create(new TestProcessor())
                .addUrl("https://www.tianyancha.com/company/59837300")
                //.setDownloader(downloader)
                .thread(1)
                .run();
    }

}
